package com.xipu.yygh.rabbit.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * description: MQ配置类
 * @author: gql
 * @date: 2022/05
 */
@Configuration
public class RabbitMQConfig {

    /**
     * 收发消息时,自动进行json与对象的互转
     * @return messageConverter, 最终会交给RabbitTemplateConfigurer
     */
    @Bean
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
